public class GamingComputerBuilder implements ComputerBuilder {
    private Computer computer;

    public GamingComputerBuilder(String baseCpu, String baseRam) {
        this.computer = new Computer(baseCpu, baseRam);  // 初始化必选组件
    }

    @Override
    public void setCPU(String cpu) {
        computer.setCpu(cpu);
    }

    @Override
    public void setRAM(String ram) {
        computer.setRam(ram);
    }

    @Override
    public void setHDD(String hdd) {
        computer.setHdd(hdd);  // 可选：设置硬盘
    }

    @Override
    public void setGPU(String gpu) {
        computer.setGpu(gpu);  // 可选：设置显卡
    }

    @Override
    public Computer build() {
        return computer;  // 返回构建完成的计算机
    }
}
